''' __slots__ 是一个列表，限定这个实例只能有哪些属性'''

class Dog():

    # __slots__ = ['kind','age','color','weight','__dict__']
    def __init__(self,kind,age,color):
        self.kind = kind
        self.age = age
        # self.color = color
        self.__color = color


d = Dog('金毛',1,'黄色')
# print(d.__dict__)
# print(Dog.__dict__)
# print(d.__slots__)
# print(Dog.__slots__)
# print(d.__color)#影藏属性的这种方式不能直接使用

